package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

@Service(loadbalance = "roundrobin")
public class HelloServiceImpl implements HelloService {

    public String sayHello(String name) {
        Object[] arguments = RpcContext.getContext().getInvocation().getArguments();
        String host = (String) arguments[0];
        System.out.println("请求地址为：" + host);
        return "hello:" + name;
    }
}
